package com.wyvoid.forum.web.action.forum;

import com.wyvoid.forum.web.action.BaseAction;
import com.wyvoid.forum.service.IForumService;
import com.wyvoid.forum.domain.Forum;
import com.wyvoid.core.sitemesh.Partial;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.action.UrlBinding;
import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.integration.spring.SpringBean;

import java.util.List;

/**
 * <p>51void.com</p>
 * User:cjp
 * Date: 2007-5-25
 * Time: 6:36:30
 */
@UrlBinding(value = "/leftMenu.do")
public class LeftMenuAction extends BaseAction {
    private List<Forum> forums;
    @SpringBean
    private IForumService forumService;


    public List<Forum> getForums() {
        return forums;
    }

    public void setForumService(IForumService forumService) {
        this.forumService = forumService;
    }

    @DefaultHandler
    @Partial
    public Resolution viewLeftMenu(){
        forums=forumService.getOpenedForums();
        return getBBSResolution("leftMenu");
    }
}
